package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Client;
import cn.wolfcode.crm.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ClientMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Client entity);

    Client selectByPrimaryKey(Long id);

    Client selectByPrimaryName(String name);

    List<Client> selectAll();

    int updateByPrimaryKey(Client entity);

    Integer query4Count(QueryObject qo);

    List<Client> query4List(QueryObject qo);

    /**
     * 指派客户池的潜在客户
     *
     * @param clientId
     */
    void join(@Param("clientId") Long clientId, @Param("salemanId") Long salemanId);

    List<Client> selectAllPoolClient();

    void traced(@Param("id") Long id, @Param("currentTime") Date currentTime);

    void abandon(Long clientId);

    //通过状态查询所有正式学员
    List<Client> selectAllStudentOfficial();

    void changeState(Long id);

    void updateSaleMan(@Param("clientId") Long clientId, @Param("saleManId") Long saleManId);
}